using System;
using System.Collections.Generic;
using System.Xml;
using System.Collections.ObjectModel;

namespace planning
{
	public abstract class Salle : Ressource
	{
		// ----- ATTRIBUTS -----
		private string nom;

		// ----- CONSTRUCTEURS -----
		public Salle()
		{
			// Start of user code for default constructor
			// End of user code for default constructor
		}

		// ----- ACCESSEURS -----
		public string Nom
		{
			get { return nom; }
			set { nom = value; ObjectChanged("nom"); }
		}


		static Dictionary<string, Salle> references = new Dictionary<string, Salle>();

		public static new Salle fromXml(XmlNode node)
		{

			Type elementType = Type.GetType("planning." + node.Name);
			if(!typeof(Salle).IsAssignableFrom(elementType))
				throw new InvalidOperationException();

			return (Salle) elementType.GetMethod("fromXml").Invoke(null, new object[] { node });
		}

	}

}
